package mapreduce;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Partitioner;
import warningreportcount.ReportCount;

public class ReportCountPartioner extends Partitioner<Text, ReportCount> {
    public int getPartition(Text text, ReportCount reportCount, int i) {
        String key = text.toString();
        String szVIN = key.split("-")[0];
        if (szVIN.contains("LA9HIGECXH1HGC00")) {
            return Integer.valueOf(szVIN.substring(szVIN.length() - 1, szVIN.length()));
        } else {
            return 0;
        }
    }
}
